package main

import (
	"fmt"
	"time"
)

func main() {

	go print()
	go devide()

	time.Sleep(time.Second * 5)

}

func print()  {
	for i := 0; i < 10; i++ {
		fmt.Println(i)
	}
}

func devide() {

	defer func() {
		err := recover()
		if err != nil {
			fmt.Println("devide出现错误: ", err)
		}
	}()

	num1 := 10
	num2 := 0
	result := num1 / num2

	fmt.Println(result)
}